package com.cbh.amadeus.common.utils;

/**
 * @author ChenBiHui
 * @date 2025/4/28
 */
public class StringUtil {

    public static boolean hasText(CharSequence str) {
        return (str != null && str.length() > 0 && containsText(str));
    }

    public static boolean hasText(String str) {
        return (str != null && !str.isEmpty() && containsText(str));
    }

    public static boolean unHasText(CharSequence str) {
        return !hasText(str);
    }

    public static boolean unhHasText(String str) {
        return !hasText(str);
    }

    private static boolean containsText(CharSequence str) {
        int strLen = str.length();
        for (int i = 0; i < strLen; i++) {
            if (!Character.isWhitespace(str.charAt(i))) {
                return true;
            }
        }
        return false;
    }
}
